package com.witmore.skyline.web.service.third.constants;

import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.UUID;

/**
 * Description: ApiClient 第三方接口常量 TP-Link
 * Author: 豆子高
 * Date: 2025/2/24 14:26
 */
public class ApiTpLinkClientConstant {

    public final static Charset UTF8 = StandardCharsets.UTF_8;

    public final static String ALGORITHM = "HmacSHA256";

    public final static String SHA_256 = "SHA-256";

    public final static String CT_JSON = "application/json; charset=utf-8";

    // terminalId可用UUID生成，每个客户端每次发送请求不需要变化
    public final static String TERMINAL_ID = UUID.randomUUID().toString().replaceAll("-", "");


    // 当请求体为空，使用此常量作为默认的payload进行签名计算
    public final static String DEFAULT_EMPTY_PAYLOAD = "{}";

    // 接口请求服务地址
    private final static String API_PREFIX = "https://api-smbcloud.tp-link.com.cn";
    public final static String HOST = "api-smbcloud.tp-link.com.cn";

    // ak
    public final static String AK = "769ec85fc8c140558ddca5f0d43d3b9a";

    // sk
    public final static String SK = "40725b4126544681863196176f6440ae";

    // 1.4.9.2 抓图任务请求地址
    public final static String SUBMIT_CAPTURE_IMAGE_TASK_PATH ="/vms/open/videoFetchService/v1/submitCaptureImageTask";
    public final static String SUBMIT_CAPTURE_IMAGE_TASK_URL = API_PREFIX + "/vms/open/videoFetchService/v1/submitCaptureImageTask";

    // 1.4.9.5 任务查询请求地址
    public final static String GET_TASK_INFO_PATH = "/vms/open/videoFetchService/v1/getTaskInfo";
    public final static String GET_TASK_INFO_URL = API_PREFIX + "/vms/open/videoFetchService/v1/getTaskInfo";

    // 1.4.9.6 文件列表请求地址
    public final static String GET_TASK_FILE_PAGE_PATH = "/vms/open/videoFetchService/v1/getTaskFilePage";
    public final static String GET_TASK_FILE_PAGE_URL = API_PREFIX + "/vms/open/videoFetchService/v1/getTaskFilePage";

    // 1.4.9.4分页查询任务列表接口
    public final static String GET_TASK_PAGE_PATH = "/vms/open/videoFetchService/v1/getTaskPage";
    public final static String GET_TASK_PAGE_URL = API_PREFIX + "/vms/open/videoFetchService/v1/getTaskPage";


    // 1.4.9.7删除云录制文件接口
    public final static String DELETE_FILE_PATH = "/vms/open/videoFetchService/v1/deleteFile";
    public final static String DELETE_FILE_URL = API_PREFIX + "/vms/open/videoFetchService/v1/deleteFile";


    // 1.4.5.3获取音视频流访问地址
    public final static String GET_STREAM_URL_PATH = "/vms/open/webServer/v1/requestStreamUrl";
    public final static String GET_STREAM_URL_URL = API_PREFIX + "/vms/open/webServer/v1/requestStreamUrl";

    // 1.4.1.1生成临时AK/SK
    public final static String GET_TEMP_AK_SK_PATH = "/tums/open/credentialManager/v1/createTempApplicationApiCredential";
    public final static String GET_TEMP_AK_SK_URL = API_PREFIX + "/tums/open/credentialManager/v1/createTempApplicationApiCredential";

    // 1.4.5.7搜索存在回放录像的日期
    public final static String GET_DEVICE_VIDEO_INFO_SEARCH_YEAR_PATH = "/vms/open/webServer/v1/searchYear";
    public final static String GET_DEVICE_VIDEO_INFO_SEARCH_YEAR_URL = API_PREFIX + "/vms/open/webServer/v1/searchYear";

    // 1.4.5.8搜索当天录像数据
    public final static String SEARCH_VIDEO_DAY_PATH = "/vms/open/webServer/v2/searchVideo";
    public final static String SEARCH_VIDEO_DAY_URL = API_PREFIX + "/vms/open/webServer/v2/searchVideo";

    // 1.4.5.9搜索当天所有人形侦测录像数据
    public final static String SEARCH_HUMAN_DETECTION_VIDEO_PATH = "/vms/open/webServer/v2/searchHumanDetectionVideo";
    public final static String SEARCH_HUMAN_DETECTION_VIDEO_URL = API_PREFIX + "/vms/open/webServer/v2/searchHumanDetectionVideo";

    // 1.4.4.6.1获取IPC/NVR设备SD卡信息
    public final static String GET_DEVICE_SD_CARD_INFO_PATH = "/vms/open/deviceConfig/v1/getDeviceSdCardInfo";
    public final static String GET_DEVICE_SD_CARD_INFO_URL = API_PREFIX + "/vms/open/deviceConfig/v1/getDeviceSdCardInfo";

    // 接口请求方式
    public final static String METHOD_POST = "POST";

    // 1.4.3.3.1获取设备详细信息
    public final static String GET_DEVICE_INFO_PATH = "/tums/open/deviceManager/v1/getDeviceDetails";
    public final static String GET_DEVICE_INFO_URL = API_PREFIX + "/tums/open/deviceManager/v1/getDeviceDetails";

    // 1.4.3.3.8修改设备名称
    public final static String UPDATE_DEVICE_NAME_PATH = "/tums/open/deviceManager/v1/modifyDeviceName";
    public final static String UPDATE_DEVICE_NAME_URL = API_PREFIX + "/tums/open/deviceManager/v1/modifyDeviceName";

}
